import { create } from 'zustand';
import { devtools } from 'zustand/middleware';

export interface SceneStore {
  mode: 'day' | 'night';
  toggle: () => void;
}

const sceneStore = create<SceneStore>()(
  devtools((set, get) => ({
    mode: 'day',
    toggle: () => {
      const { mode } = get();
      set({ mode: mode === 'day' ? 'night' : 'day' });
    },
  })),
);

export default sceneStore;
